import {defineAsyncComponent} from 'vue';

const componentsName = import.meta.glob('./home/atom/*.vue', { eager: true });
const components = import.meta.glob('./home/atom/*.vue');

export default function (app) {
    for (const [key, value] of Object.entries(components)) {
        // 注册组件名字   没有抛出Name， 引用文件组件文件夹名字<>
        const name = componentsName[key].default.name || key.slice(31, key.lastIndexOf('/'));
        if (name.includes('jRow')) continue
        app.component(name, defineAsyncComponent(value));
        console.log(name + '--' + value)
    }
}
